{% load static %}
<div id="actions-{{ loop_id }}" x-show="show_actions_{{ loop_id }}" x-cloak
     x-transition:enter="duration-300 ease-out" x-transition:enter-start="opacity-0 scale-90"
     x-transition:enter-end="opacity-100 scale-100"
     class="flex flex-col absolute top-8 right-5 md:right-7 z-20 py-1 px-2 rounded-sm border text-base!
            [&>a]:py-1 [&>a]:px-2 [&>a]:flex [&>a]:items-center [&>a]:gap-x-2 [&>a]:rounded-sm
            text-slate-800 bg-slate-200 border-slate-300 [&>a]:hover:bg-slate-300
            dark:text-slate-200 dark:bg-slate-700 dark:border-slate-600 dark:[&>a]:hover:bg-slate-600
            creme:text-stone-700 creme:bg-creme-dark-light creme:border-creme-dark creme:[&>a]:hover:bg-creme-dark">
    <a href="{% url 'pdf_details' pdf.id %}">
        <svg fill="currentColor" class="w-5 h-5" version="1.1" xmlns="http://www.w3.org/2000/svg"
             viewBox="0 0 330 330" xml:space="preserve">
            <!-- source: https://www.svgrepo.com/svg/65094/information -->
            <!-- license: CC0 License-->
            <g>
                <path d="M165,0C74.019,0,0,74.02,0,165.001C0,255.982,74.019,330,165,330s165-74.018,165-164.999C330,74.02,255.981,0,165,0z M165,300c-74.44,0-135-60.56-135-134.999C30,90.562,90.56,30,165,30s135,60.562,135,135.001C300,239.44,239.439,300,165,300z"/>
                <path d="M164.998,70c-11.026,0-19.996,8.976-19.996,20.009c0,11.023,8.97,19.991,19.996,19.991 c11.026,0,19.996-8.968,19.996-19.991C184.994,78.976,176.024,70,164.998,70z"/>
                <path d="M165,140c-8.284,0-15,6.716-15,15v90c0,8.284,6.716,15,15,15c8.284,0,15-6.716,15-15v-90C180,146.716,173.284,140,165,140z"/>
            </g>
        </svg>
        Details
    </a>
    <a href="{% url 'share_pdf' pdf.id %}">
        <svg fill="currentColor" class="w-5 h-5" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" ><title>share</title>
            <!-- source: https://www.svgrepo.com/svg/367868/share -->
            <!-- license: PD License-->
            <path d="M385 464Q357 464 339 445 320 426 320 399 320 390 321 388L171 303Q154 320 129 320 102 320 83 301 64 282 64 255 64 229 83 211 102 192 129 192 154 192 171 209L321 125Q320 122 320 111 320 85 339 67 357 48 384 48 410 48 429 67 447 85 448 111 448 138 429 157 410 176 384 176 361 176 341 159L191 244Q192 246 192 255 192 265 191 268L341 353Q361 336 385 336 415 336 431 355 447 374 447 400 447 426 431 445 415 464 385 464Z" />
        </svg>
        Share
    </a>
    <a id="star-{{ loop_id }}" class="cursor-pointer"
       hx-post="{% url 'star' pdf.id %}"
       hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'>
        <svg class="w-5 h-5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
            <!-- source: https://www.svgrepo.com/svg/471930/star-01 -->
            <!-- license: CC0 License-->
            <path d="M11.2827 3.45332C11.5131 2.98638 11.6284 2.75291 11.7848 2.67831C11.9209 2.61341 12.0791 2.61341 12.2152 2.67831C12.3717 2.75291 12.4869 2.98638 12.7174 3.45332L14.9041 7.88328C14.9721 8.02113 15.0061 8.09006 15.0558 8.14358C15.0999 8.19096 15.1527 8.22935 15.2113 8.25662C15.2776 8.28742 15.3536 8.29854 15.5057 8.32077L20.397 9.03571C20.9121 9.11099 21.1696 9.14863 21.2888 9.27444C21.3925 9.38389 21.4412 9.5343 21.4215 9.68377C21.3988 9.85558 21.2124 10.0372 20.8395 10.4004L17.3014 13.8464C17.1912 13.9538 17.136 14.0076 17.1004 14.0715C17.0689 14.128 17.0487 14.1902 17.0409 14.2545C17.0321 14.3271 17.0451 14.403 17.0711 14.5547L17.906 19.4221C17.994 19.9355 18.038 20.1922 17.9553 20.3445C17.8833 20.477 17.7554 20.57 17.6071 20.5975C17.4366 20.6291 17.2061 20.5078 16.7451 20.2654L12.3724 17.9658C12.2361 17.8942 12.168 17.8584 12.0962 17.8443C12.0327 17.8318 11.9673 17.8318 11.9038 17.8443C11.832 17.8584 11.7639 17.8942 11.6277 17.9658L7.25492 20.2654C6.79392 20.5078 6.56341 20.6291 6.39297 20.5975C6.24468 20.57 6.11672 20.477 6.04474 20.3445C5.962 20.1922 6.00603 19.9355 6.09407 19.4221L6.92889 14.5547C6.95491 14.403 6.96793 14.3271 6.95912 14.2545C6.95132 14.1902 6.93111 14.128 6.89961 14.0715C6.86402 14.0076 6.80888 13.9538 6.69859 13.8464L3.16056 10.4004C2.78766 10.0372 2.60121 9.85558 2.57853 9.68377C2.55879 9.5343 2.60755 9.38389 2.71125 9.27444C2.83044 9.14863 3.08797 9.11099 3.60304 9.03571L8.49431 8.32077C8.64642 8.29854 8.72248 8.28742 8.78872 8.25662C8.84736 8.22935 8.90016 8.19096 8.94419 8.14358C8.99391 8.09006 9.02793 8.02113 9.09597 7.88328L11.2827 3.45332Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
        </svg>
        {% if pdf.starred %}
        Unstar
        {% else %}
        Star
        {% endif %}
    </a>
    <a id="archive-{{ loop_id }}" class="cursor-pointer"
       hx-post="{% url 'archive' pdf.id %}"
       hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'>
        <svg class="w-5 h-5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
            <!-- source: https://www.svgrepo.com/svg/470978/archive -->
            <!-- license: CC0 License-->
            <path d="M4 7.9966C3.83599 7.99236 3.7169 7.98287 3.60982 7.96157C2.81644 7.80376 2.19624 7.18356 2.03843 6.39018C2 6.19698 2 5.96466 2 5.5C2 5.03534 2 4.80302 2.03843 4.60982C2.19624 3.81644 2.81644 3.19624 3.60982 3.03843C3.80302 3 4.03534 3 4.5 3H19.5C19.9647 3 20.197 3 20.3902 3.03843C21.1836 3.19624 21.8038 3.81644 21.9616 4.60982C22 4.80302 22 5.03534 22 5.5C22 5.96466 22 6.19698 21.9616 6.39018C21.8038 7.18356 21.1836 7.80376 20.3902 7.96157C20.2831 7.98287 20.164 7.99236 20 7.9966M10 13H14M4 8H20V16.2C20 17.8802 20 18.7202 19.673 19.362C19.3854 19.9265 18.9265 20.3854 18.362 20.673C17.7202 21 16.8802 21 15.2 21H8.8C7.11984 21 6.27976 21 5.63803 20.673C5.07354 20.3854 4.6146 19.9265 4.32698 19.362C4 18.7202 4 17.8802 4 16.2V8Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
        </svg>
        {% if pdf.archived %}
        Unarchive
        {% else %}
        Archive
        {% endif %}
    </a>
    <a id="delete-{{ loop_id }}" class="cursor-pointer"
       @click="show_delete_pdf_modal = true"
       hx-get="{% url 'delete_pdf' pdf.id %}"
       hx-target="#delete_pdf_modal"
       hx-swap="innerHTML">
        <img src="{% static 'images/trash.svg' %}" width="19">
        Delete
    </a>
</div>
